package com.jms.web.mvc.web;

import com.jms.web.mvc.servlet.DispatcherServlet;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import java.util.Set;

public class MvcServletContainerInitializer implements ServletContainerInitializer {
    @Override
    public void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException {
        ServletRegistration.Dynamic dispatcherServletRegistration = ctx.addServlet("dispatcherServlet", DispatcherServlet.getInstance());
        dispatcherServletRegistration.addMapping("/*");
    }
}
